<script>
	export default {
		globalData: {
			statusBarHeight: 0,  	// 状态栏高度
			navHeight: 0,			// 导航栏高度
			winHeight: 0,         	// 屏幕高度
			capHeight: 0,			// 胶囊高度
			safeArea: 0,			// 安全区域高度
		},
		onLaunch: function() {
			let that = this
			let menuButton = uni.getMenuButtonBoundingClientRect()
			uni.getSystemInfo({
				success: function(res) {
					let data = that.globalData
					data.statusBarHeight = res.statusBarHeight
					data.navHeight = menuButton.height + (menuButton.top - res.statusBarHeight) * 2 
					data.winHeight = res.windowHeight
					data.capHeight = menuButton.height
					data.safeArea = res.safeArea.height - res.statusBarHeight - data.navHeight 
				}
			})
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	*{
		padding: 0;
		margin: 0;
	}
	page{
		background-color: #f8f8fb;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}
</style>
